package com.yidiandao.business.data.recyclertype;

import android.os.Parcel;
import android.os.Parcelable;

import com.google.gson.annotations.SerializedName;
import com.yidiandao.business.data.bean.PayWay;
import com.yidiandao.business.data.bean.ShareEntity;

import java.util.ArrayList;
import java.util.List;

/**
 * 发现-文章
 * <p>
 * Created by ChenTao(chentao7v@gmail.com) on 2017/4/13 0013 18:24
 */
public class Article implements Parcelable {

    @SerializedName("article_id")
    private String articleId;

    @SerializedName("article_title")
    private String articleTitle;

    @SerializedName("article_desc")
    private String articleDesc;

    @SerializedName("article_thumb")
    private String articleThumb;

    @SerializedName("comment_count")
    private String commentCount;

    @SerializedName("vote_count")
    private String voteCount;

    @SerializedName("watch_count")
    private String watchCount;

    @SerializedName("has_vote")
    private int hasVote;

    @SerializedName("add_time")
    private long addTime;

    @SerializedName("thumb_type")
    private String thumbType;

    @SerializedName("cat_name")
    private String catName;

    @SerializedName("type")
    private String type;

    @SerializedName("bottom_button")
    private Extra extra;

    @SerializedName("url")
    private String url;

    @SerializedName("is_end")
    private int isEnd;

    @SerializedName("enroll_money")
    private String enrollMoney;

    @SerializedName("share_info")
    private ShareEntity shareEntity;

    public String getEnrollMoney() {
        return enrollMoney;
    }

    public void setEnrollMoney(String enrollMoney) {
        this.enrollMoney = enrollMoney;
    }

    public int getIsEnd() {
        return isEnd;
    }

    public void setIsEnd(int isEnd) {
        this.isEnd = isEnd;
    }

    public ShareEntity getShareEntity() {
        return shareEntity;
    }

    public void setShareEntity(ShareEntity shareEntity) {
        this.shareEntity = shareEntity;
    }

    public Extra getExtra() {
        return extra;
    }

    public void setExtra(Extra extra) {
        this.extra = extra;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getArticleId() {
        return articleId;
    }

    public void setArticleId(String articleId) {
        this.articleId = articleId;
    }

    public String getArticleTitle() {
        return articleTitle;
    }

    public void setArticleTitle(String articleTitle) {
        this.articleTitle = articleTitle;
    }

    public String getArticleDesc() {
        return articleDesc;
    }

    public void setArticleDesc(String articleDesc) {
        this.articleDesc = articleDesc;
    }

    public String getArticleThumb() {
        return articleThumb;
    }

    public void setArticleThumb(String articleThumb) {
        this.articleThumb = articleThumb;
    }

    public String getCommentCount() {
        return commentCount;
    }

    public void setCommentCount(String commentCount) {
        this.commentCount = commentCount;
    }

    public String getVoteCount() {
        return voteCount;
    }

    public void setVoteCount(String voteCount) {
        this.voteCount = voteCount;
    }

    public String getWatchCount() {
        return watchCount;
    }

    public void setWatchCount(String watchCount) {
        this.watchCount = watchCount;
    }

    public int getHasVote() {
        return hasVote;
    }

    public void setHasVote(int hasVote) {
        this.hasVote = hasVote;
    }

    public long getAddTime() {
        return addTime;
    }

    public void setAddTime(long addTime) {
        this.addTime = addTime;
    }

    public String getThumbType() {
        return thumbType;
    }

    public void setThumbType(String thumbType) {
        this.thumbType = thumbType;
    }

    public String getCatName() {
        return catName;
    }

    public void setCatName(String catName) {
        this.catName = catName;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public static class Extra implements Parcelable {

        public interface Key {
            String ENROLL = "enroll";
            String BUY_GOODS = "buyGoods";
        }

        @SerializedName("button_key")
        private String buttonKey;

        @SerializedName("button_name")
        private String buttonName;

        @SerializedName("enable")
        private int enable;

        @SerializedName("enroll_title")
        private String enrollTitle;

        @SerializedName("enroll_id")
        private String enrollId;

        @SerializedName("enroll_money")
        private float enrollMoney;

        @SerializedName("enroll_max_persons")
        private int maxPerson;

        @SerializedName("payment_list")
        private List<PayWay> payWays;

        @SerializedName("goods_id")
        private String goodsId;

        public String getGoodsId() {
            return goodsId;
        }

        public void setGoodsId(String goodsId) {
            this.goodsId = goodsId;
        }

        public List<PayWay> getPayWays() {
            return payWays;
        }

        public void setPayWays(List<PayWay> payWays) {
            this.payWays = payWays;
        }

        public float getEnrollMoney() {
            return enrollMoney;
        }

        public void setEnrollMoney(float enrollMoney) {
            this.enrollMoney = enrollMoney;
        }

        public int getMaxPerson() {
            return maxPerson;
        }

        public void setMaxPerson(int maxPerson) {
            this.maxPerson = maxPerson;
        }

        public String getButtonKey() {
            return buttonKey;
        }

        public void setButtonKey(String buttonKey) {
            this.buttonKey = buttonKey;
        }

        public String getButtonName() {
            return buttonName;
        }

        public void setButtonName(String buttonName) {
            this.buttonName = buttonName;
        }

        public int getEnable() {
            return enable;
        }

        public void setEnable(int enable) {
            this.enable = enable;
        }

        public String getEnrollTitle() {
            return enrollTitle;
        }

        public void setEnrollTitle(String enrollTitle) {
            this.enrollTitle = enrollTitle;
        }

        public String getEnrollId() {
            return enrollId;
        }

        public void setEnrollId(String enrollId) {
            this.enrollId = enrollId;
        }

        public Extra() {
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(this.buttonKey);
            dest.writeString(this.buttonName);
            dest.writeInt(this.enable);
            dest.writeString(this.enrollTitle);
            dest.writeString(this.enrollId);
            dest.writeFloat(this.enrollMoney);
            dest.writeInt(this.maxPerson);
            dest.writeList(this.payWays);
        }

        protected Extra(Parcel in) {
            this.buttonKey = in.readString();
            this.buttonName = in.readString();
            this.enable = in.readInt();
            this.enrollTitle = in.readString();
            this.enrollId = in.readString();
            this.enrollMoney = in.readFloat();
            this.maxPerson = in.readInt();
            this.payWays = new ArrayList<PayWay>();
            in.readList(this.payWays, PayWay.class.getClassLoader());
        }

        public static final Creator<Extra> CREATOR = new Creator<Extra>() {
            @Override
            public Extra createFromParcel(Parcel source) {
                return new Extra(source);
            }

            @Override
            public Extra[] newArray(int size) {
                return new Extra[size];
            }
        };
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.articleId);
        dest.writeString(this.commentCount);
        dest.writeString(this.voteCount);
        dest.writeInt(this.hasVote);
        dest.writeParcelable(this.extra, flags);
        dest.writeParcelable(this.shareEntity, flags);
    }

    public Article() {
    }

    protected Article(Parcel in) {
        this.articleId = in.readString();
        this.commentCount = in.readString();
        this.voteCount = in.readString();
        this.hasVote = in.readInt();
        this.extra = in.readParcelable(Extra.class.getClassLoader());
        this.shareEntity = in.readParcelable(ShareEntity.class.getClassLoader());
    }

    public static final Parcelable.Creator<Article> CREATOR = new Parcelable.Creator<Article>() {
        @Override
        public Article createFromParcel(Parcel source) {
            return new Article(source);
        }

        @Override
        public Article[] newArray(int size) {
            return new Article[size];
        }
    };
}
